package io.renren.common.utils.password;

import java.util.ArrayList;
import java.util.List;

/**
 * 密码校验配置类
 *
 * @author txb
 * @since 2023-12-01 8:56
 */
public class PasswordConstant {

    //密码检测开关
    public final static boolean PASS_WORD_CHECK_SWITCH = true;
    //是否检测密码口令长度标识
    public final static boolean CHECK_PASSWORD_LENGTH = true;
    //密码最小长度
    public final static int LIMIT_PASSWORD_MIN_LENGTH = 8;
    //密码最大长度
    public final static Integer LIMIT_PASSWORD_MAX_LENGTH = 20;
    //是否包含数字
    public final static boolean CHECK_CONTAIN_DIGIT = true;
    //是否区分大小写
    public final static boolean CHECK_CONTAIN_UPPER_LOWER_CASE = false;
    //是否包含小写字母
    public final static boolean CHECK_CONTAIN_LOWER_CASE = true;
    //是否包含大写字母
    public final static boolean CHECK_CONTAIN_UPPER_CASE = true;
    //是否包含特殊符号
    public final static boolean CHECK_CONTAIN_SPECIAL_CHAR = true;
    //特殊符号集合
    public final static String DEFAULT_SPECIAL_CHAR = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¢£¤¥¦§¨©ª«¬\u00ad®¯°±²³´µ¶·¸¹º»¼½¾¿×÷–—―‗‘’‚‛“”„†‡•…‰′″‹›‼‾⁄⁊₠₡₢₣₤₥₦₧₨₩₪₫€₭₮₯₰₱₲₳₴₵₶₷₸₹₺₻₼₽₾";
    //是否检测键盘按键横向连续,如qwer等
    public final static boolean CHECK_HORIZONTAL_KEY_SEQUENTIAL = false;
    //键盘物理位置横向不允许最小的连续个数
    public final static int LIMIT_HORIZONTAL_KEY_NUMBER = 3;
    //是否检测键盘按键斜向连续,如qaz
    public final static boolean CHECK_SLOPE_KEY_SEQUENTIAL = false;
    //键盘物理位置斜向不允许最小的连续个数
    public final static int LIMIT_SLOPE_KEY_NUMBER = 3;
    //是否检测逻辑位置连续,如1234、abcd等
    public final static boolean CHECK_LOGIC_SEQUENTIAL = false;
    //密码口令中字符在逻辑位置上不允许最小的连续个数
    public final static int LIMIT_LOGIC_NUMBER = 3;
    //是否检测连续字符相同,如aaaa、1111、####等
    public final static boolean CHECK_SEQUENTIAL_CHAR_SAME = false;
    //密码口令中相同字符不允许最小的连续个数
    public final static int LIMIT_SEQUENTIAL_CHAR_NUMBER = 3;
    //是否校验自定义密码集合
    public final static boolean CHECK_CUSTOM_PASSWORD_ARRAY = false;
    //自定义密码集合
    public final static List<String> CUSTOM_PASSWORD_ARRAY = new ArrayList<>();
    //键盘横向方向规则
    public final static String[] KEYBOARD_HORIZONTAL_ARR = {"01234567890", "qwertyuiop", "asdfghjkl", "zxcvbnm"};
    //键盘斜线方向规则
    public final static String[] KEYBOARD_SLOPE_ARR = {
            "1qaz", "2wsx", "3edc", "4rfv", "5tgb", "6yhn", "7ujm", "8ik,", "9ol.", "0p;/", "=[;.", "-pl,", "0okm", "9ijn", "8uhb", "7ygv", "6tfc", "5rdx", "4esz",
            "!QAZ", "@WSX", "#EDC", "$RFV", "%TGB", "^YHN", "&UJM", "*IK<", "(OL>", ")P:?", "+{:>", "_PL<", ")OKM", "(IJN", "*UHB", "&YGV", "^TFC", "%RDX", "$ESZ"
    };
    //是否检测空格、换行、回车等字符
    public final static boolean CHECK_WHITE_SPACE = true;
    //空格、换行、回车等字符
    public static final char[] CHARS = new char[]{'\t', '\n', '\u000b', '\f', '\r', ' '};
}
